/**
 *
 */
package com.naiterui.ehp.bs.doctor.repository;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.domain.Department;

/**
 * @Description 科室持久层
 */
@Repository
public interface IDepartmentRepository extends BaseJpaRepository<Department, Integer> {


    List<Department> findByAvailableOrderBySort(boolean available);

    List<Department> findByIdInAndAvailableOrderBySort(List<Integer> ids, boolean available);

    List<Department> findByAvailableAndCreatedAtBetween(boolean available, Date start, Date end);

    Department findFirstByNameAndParentIdNot(String name, Integer parentId);
}
